package com.sm.honkon.ui.fragment.signuse

import android.os.Bundle
import androidx.core.os.bundleOf
import com.sm.honkon.R
import com.sm.honkon.app.base.BaseFragment
import com.sm.honkon.databinding.FrgSignLoginBinding
import com.sm.honkon.ui.model.SignUseLoginViewModel
import kotlinx.android.synthetic.main.frg_sign_login.*
import me.hgj.jetpackmvvm.ext.nav
import me.hgj.jetpackmvvm.ext.navigateAction

class SignUseLoginFragment:BaseFragment<SignUseLoginViewModel,FrgSignLoginBinding>() {
    override fun layoutId(): Int  = R.layout.frg_sign_login

    override fun initView(savedInstanceState: Bundle?) {
        mDatabind.model = mViewModel
        tv_login.setOnClickListener {
            mViewModel.login {
                nav().navigateAction(R.id.action_signUseLoginFragment_to_signUseFragment)
            }
        }
        tv_forget.setOnClickListener {
            nav().navigate(R.id.resetAdminFragment, bundleOf("isFromLogin" to false))
        }
    }
}